// 详情页面结构JSON
const informationFormRow = [
  {
    elCol: [
      {
        label: "单据id",
        prop: "bm_id",
        tag: "elInput",
        disabled: true,
      },
      {
        label: "上级菜单",
        prop: "fatherMenuName",
        tag: "elDialog",
      },
    ],
  },
  {
    elCol: [
      {
        label: "控制器名",
        prop: "bm_controllerName",
        tag: "elInput",
      },
      {
        label: "单据类型",
        prop: "bm_type",
        tag: "elRadio",
        options: [
          {
            label: "业务单据",
            value: 1,
          },
          {
            label: "系统功能",
            value: 0,
          },
          {
            label: "档案",
            value: 2,
          },
        ],
        disabled: false,
      },
    ],
  },
  {
    elCol: [
      {
        label: "审批流",
        prop: "bm_IsApprover",
        tag: "elSwitch",
        activeText: "开启",
        activeValue: 1,
        inactiveText: "关闭",
        inactiveValue: 0,
      },
      {
        label: "附件",
        prop: "bm_IsAttachment",
        tag: "elSlot",
        slotName: "bm_IsAttachment",
      },
    ],
  },
  {
    elCol: [
      {
        label: "功能名称",
        prop: "bm_functionName",
        tag: "elInput",
        span: 24,
      },
    ],
  },
  {
    elCol: [
      {
        label: "功能介绍",
        prop: "bm_functionExplain",
        tag: "elInput",
        type: "textarea",
        rows: 6,
        span: 24,
      },
    ],
  },
];
// 详情页必填项
const informationRules = {
  fatherMenuName: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
  bm_controllerName: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
  bm_functionName: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
  bm_functionExplain: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
  bm_type: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
  bm_openType: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
  bm_AttachmentFolder: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
};
// 数据源——数据表表头
const tablesColumn = [
  {
    label: "中文名",
    prop: "tableNameCN",
    tooltip: true,
  },
  {
    label: "英文名",
    prop: "tableNameEN",
    tooltip: true,
  },
  {
    label: "表类型",
    prop: "tableType",
    tooltip: true,
    stateOption: {
      1: "主表",
      2: "子表",
      3: "孙表",
    },
  },
  {
    label: "关联表",
    prop: "associatedTable",
    tooltip: true,
  },
  {
    label: "表字段",
    prop: "associatedColumn",
    tooltip: true,
  },
  {
    label: "表说明",
    prop: "remark",
    tooltip: true,
  },
  {
    label: "数据库结构",
    prop: "isCreate",
    tooltip: true,
  },
  {
    label: "操作",
    prop: "operate",
    // tooltip: true,
    width: 60,
  },
];
// 数据库表名JSON
const tablesFormRow = [
  {
    elCol: [
      {
        label: "中文名称",
        prop: "tableNameCN",
        tag: "elInput",
        span: 24,
      },
    ],
  },
  {
    elCol: [
      {
        label: "英文名",
        prop: "tableNameEN",
        tag: "elSlot",
        slotName: "tableNameEN",
        span: 24,
      },
    ],
  },
  {
    elCol: [
      {
        label: "表类型",
        prop: "tableType",
        span: 24,
        tag: "elRadio",
        options: [
          {
            label: "主表",
            value: 1,
          },
          {
            label: "子表",
            value: 2,
          },
          {
            label: "孙表",
            value: 3,
          },
        ],
      },
    ],
  },
  {
    elCol: [
      {
        label: "关联表名称",
        prop: "associatedTable",
        tag: "elInput",
        span: 24,
      },
    ],
  },
  {
    elCol: [
      {
        label: "关联表字段",
        prop: "associatedColumn",
        tag: "elInput",
        span: 24,
      },
    ],
  },
  {
    elCol: [
      {
        label: "表说明",
        prop: "remark",
        tag: "elInput",
        type: "textarea",
        span: 24,
      },
    ],
  },
];
const tablesRules = {
  tableNameCN: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
  tableNameEN: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
  tableType: [
    {
      required: true,
      message: "请输入选项值",
      trigger: "blur",
    },
  ],
  // associatedTable:[{
  // 	required:true,
  // 	message:'请输入选项值',
  // 	trigger:'blur'
  // }],
  // associatedColumn:[{
  // 	required:true,
  // 	message:'请输入选项值',
  // 	trigger:'blur'
  // }],
};
//数据源——表字段表头
const tableCoulmnColumn = [
  {
    label: "中文名",
    prop: "fieldNameCN",
    // tooltip: true,
    width: 150,
  },
  {
    label: "字段名",
    prop: "fieldNameEN",
    // tooltip: true,
    width: 150,
  },

  {
    label: "字段类型",
    prop: "fieldType",
    width: 180,
    // tooltip: true,
  },
  {
    label: "长度",
    prop: "fieldTypeLength",
    // tooltip: true,
    width: 100,
  },
  {
    label: "必填",
    prop: "isMustFill",
    // tooltip: true,
    width: 80,
  },
  {
    label: "显示",
    prop: "isVisible",
    // tooltip: true,
    width: 80,
  },
  {
    label: "显示类型",
    prop: "dataType",
    width: 125,
    // tooltip: true,
  },
  {
    label: "数据类型",
    prop: "displayType",
    // tooltip: true,
  },
  // {
  // 	label: '字段说明',
  // 	prop: 'displayType',
  // 	tooltip: true,
  // 	width: 75
  // },
  {
    label: "数据源",
    prop: "dataSource",
    // tooltip: true,
  },
  {
    label: "操作",
    prop: "operate",
    // tooltip: true,
    width: 75,
  },
];

export default {
  informationFormRow,
  informationRules,
  tablesColumn,
  tablesFormRow,
  tablesRules,
  tableCoulmnColumn,
};
